From: Florian Müllner Date: Thu, 2 May 2024 17:53:04 +0000 (+0200) Subject: messageList: Only apply special styling to symbolic icons X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~226^2^2~177 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=a94b80b2d4b1bb751027b3b448e2094b535af8ee;p=gnome-shell.git messageList: Only apply special styling to symbolic icons The styling introduced in commit 8fed0b83d was only intended for symbolics, it looks weird when applied to full-color icons. So instead of using the GIcon type, apply the special styling based on the new StIcon:is-symbolic property. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7620 Part-of: --- diff --git a/js/ui/messageList.js b/js/ui/messageList.js index dda9f22a9..c3039e020 100644 --- a/js/ui/messageList.js +++ b/js/ui/messageList.js @@ -478,6 +478,13 @@ export const Message = GObject.registerClass({ }); hbox.add_child(this._icon); + this._icon.connect('notify::is-symbolic', () => { + if (this._icon.is_symbolic) + this._icon.add_style_class_name('message-themed-icon'); + else + this._icon.remove_style_class_name('message-themed-icon'); + }); + const contentBox = new St.BoxLayout({ style_class: 'message-content', vertical: true, @@ -534,11 +541,6 @@ export const Message = GObject.registerClass({ set icon(icon) { this._icon.gicon = icon; - if (icon instanceof Gio.ThemedIcon) - this._icon.add_style_class_name('message-themed-icon'); - else - this._icon.remove_style_class_name('message-themed-icon'); - this._icon.visible = !!icon; this.notify('icon'); }